<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


    <p  id="timeout" name="timeout" hidden data-timeout="${TIME_OUT}" ></p>
    <div class="dgg-list-top-warp">
        <div class="screen-search">
            <ul>
                <li>
                    <label>客户姓名：</label>
                    <input type="text" class="dggui-input dggui-input-normal" id="customerName" name="customerName" placeholder="输入客户姓名" maxlength="50">
                </li>
                <li>
                    <label>所属生产事业部：</label>
                    <select id="productOrgId" name="productOrgId" >
                    </select>
                </li>
               <%-- <li>
                    <label>订单状态：</label>
                    <select name="orderStatus" id="orderStatus" style="min-width: 80px; display: none;">
                    </select>
                </li>--%>
                <li>
                    <label>业务类型：</label>
                    <div name="typeCode" id="typeCode"></div>
                </li>
                <li>
                    <label>产品：</label>
                    <select name="productCode" id="productCode" style="min-width: 80px; display: none;">
                    </select>
                </li>
                <li>
                    <label>渠道：</label>
                    <select name="channelCode" id="channelCode" class="dggui-select">
                        <option value=''>请选择</option>
                    </select>
                </li>
                <li>
                    <label>当前节点：</label>
                    <select name="nodeId" id="nodeId" class="dggui-select">
                        <option value=''>请选择</option>
                    </select>
                </li>
                <li>
                    <label>流程人员：</label>
                    <select id="flowUserId" name="flowUserId"  >
                    </select>
                </li>
               <%-- <li>
                    <label>协单人员：</label>
                    <select id="assistUser" name="assistUser"  >
                    </select>
                </li>--%>
                <li>
                    <label>签单商务：</label>
                    <select  id="signUserId" name="signUserId">
                    </select>
                </li>
                <li>
                    <label>签单部门：</label>
                    <div class="tree-select-warp">
                        <input type="text" class="dggui-input input-selct-tree" id="signOrg" name="signOrg"  data-id="" value="" style="width: 320px" />
                    </div>
                </li>
                <li>
                    <label>签单时间：</label>
                    <input type="text" readonly class="dggui-input dggui-time-range" id="signTime" name="signTime">
                    <i class="iconfont icon-rili"></i>
                </li>
                <li>
                    <label>接单时间：</label>
                    <input type="text" readonly class="dggui-input dggui-time-range" id="receiveOrderDate" name="receiveOrderDate">
                    <i class="iconfont icon-rili"></i>
                </li>
         <%--       <li>
                    <label>分配时间：</label>
                    <input type="text" readonly class="dggui-input" id="allotDate" name="allotDate">
                </li>--%>

               <%-- <li>
                    <label>协单：</label>
                    <select id="assist" name="assist"  class="dggui-select">
                        <option value="">请选择</option>
                        <option value="1">不看协单</option>
                        <option value="2">只看协单</option>
                    </select>
                </li>--%>
                <li>
                    <label>超期状态：</label>
                    <select  id="SQSTATUS" name="SQSTATUS" class="dggui-select">
                        <option value="">全部</option>
                        <option value="OUT_TIME_STATE1">未超期</option>
                        <option value="OUT_TIME_STATE3">接收超期</option>
                        <option value="OUT_TIME_STATE4">节点超期</option>
                        <option value="OUT_TIME_STATE5">订单超期</option>
                    </select>
                </li>
                <li>
                    <label>关键字：</label>
                    <input type="text" class="dggui-input dggui-input-large" id="searchKey" name="searchKey" placeholder="订单编号/生产单编号/客户号码" maxlength="50" style="width: 190px;">
                </li>
           <%--     <li>
                    <label>需求金额：</label>
                    <input type="number" class="dggui-input dggui-input-large" id="moneyMin" name="moneyMin" placeholder="输入最小金额" min="0">~
                    <input type="number" class="dggui-input dggui-input-large" id="moneyMax" name="moneyMax" placeholder="输入最大金额" min="0">
                </li>--%>
                <li>
                    <button class="dggui-btn searchBtn" >搜索</button>
                    <button class="dggui-btn dggui-btn-primary"  onclick="cleanSearch()">清空条件</button>
                    <d:hasUrlAuth authCode="RZSC_OPERATION_EXPORT">
                    <button class="dggui-btn dggui-btn-green" onclick="excelExportWaitReceive()">导出</button>
                    </d:hasUrlAuth>
                </li>
            </ul>
        </div>
    </div>
    <div class="list-content">
        <div class="tool-bar">
            <div class="fl"  id="waitAcdept">
                <d:hasUrlAuth authCode="RZSC_OPERATION_CALL">
                <a href="javascript:void(0)"class="dggui-btn" onclick="callPhoneByProduction($('#inProcess'))">打电话</a>
                </d:hasUrlAuth>
                <d:hasUrlAuth authCode="RZSC_OPERATION_BACK_ORDER">
                <a href="javascript:void(0)"class="dggui-btn" onclick="abandon($('#inProcess'))">退单</a>
                </d:hasUrlAuth>
                <d:hasUrlAuth authCode="RZSC_OPERATION_BACK_ORDER">
                <a href="javascript:void(0)"class="dggui-btn" onclick="transfer()">转单</a>
                </d:hasUrlAuth>
                <d:hasUrlAuth authCode="RZSC_OPERATION_WASTE_BILL">
                <a href="javascript:void(0)"class="dggui-btn" onclick="nullify($('#inProcess'))">废单</a>
                </d:hasUrlAuth>
                <d:hasUrlAuth authCode="RZSC_OPERATION_UPDATE_NODE">
                <a href="javascript:void(0)"class="dggui-btn" onclick="openUpdateNode('inProcess',null)">更新节点</a>
                </d:hasUrlAuth>

                <d:hasUrlAuth authCode="RZSC_OPERATION_ADD_ASSISTANT">
                <a href="javascript:void(0)"class="dggui-btn" onclick="addAssist('inProcess')">添加协单人员</a>
                </d:hasUrlAuth>
                <%--<d:hasUrlAuth authCode="RZSC_OPERATION_ADD_CHANNEL">--%>
                <%--<a href="javascript:void(0)"class="dggui-btn" onclick="addChannel('inProcess')">新增渠道</a>--%>
                <%--</d:hasUrlAuth>--%>
                <%--<d:hasUrlAuth authCode="RZSC_OPERATION_CHANGE_CHANNEL">--%>
                    <%--<a href="javascript:void(0)"class="dggui-btn" onclick="updateChannel('inProcess')">更换渠道</a>--%>
                <%--</d:hasUrlAuth>--%>
                <a href="javascript:void(0)"class="dggui-btn" onclick="addProduct('inProcess')">新增产品</a>
                <a href="javascript:void(0)"class="dggui-btn" onclick="changeProduct('inProcess')">更换产品</a>
                <d:hasUrlAuth authCode="RZSC_OPERATION_PAUSE">
                <a href="javascript:void(0)"class="dggui-btn"  onclick="suspend($('#inProcess'))">暂缓</a>
                </d:hasUrlAuth>
            </div>
            <div class="fr node-state" >
                <ul>
                    <li class="over-finish">订单超期</li>
                    <li>节点超期</li>
                    <li class="over">接收超期</li>
                </ul>
            </div>
        </div>
        <div class="table-warp">
            <table class="dggui-table" id="inProcess">
        </table>
        </div>
    </div>


<script src="${rootUrl}/static/js/rzsc/processingOrder/processingOrder.js?v=${version}" type="text/javascript"></script>
<script src="${rootUrl}/static/js/rzsc/common/dealDataTool.js?v=${version}" type="text/javascript"></script>
<script src="${rootUrl}/static/js/rzsc/common/verificationTool.js?v=${version}" type="text/javascript"></script>


<script>


    /**
     * 转单
     */
    function transfer(){
        var checkDate = $('#inProcess').dataTableExtend('getCheck');
        if(checkDate.length < 1){
            dggui.dialog.errors('未勾选订单！');
            return;
        }
        var ids = [];
        for(var i=0;i<checkDate.length;i++){
            ids.push(checkDate[i].id);
        }
        ids = ids.join(",");
        transferOrder(ids,$('#inProcess'));
    }
</script>